package com.jacky.grpc.proto;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 * <pre>
 * 定义gRpc服务
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.63.0)",
    comments = "Source: hello.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class SimpleGrpc {

  private SimpleGrpc() {}

  public static final java.lang.String SERVICE_NAME = "Simple";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "SayHello",
      requestType = com.jacky.grpc.proto.HelloRequest.class,
      responseType = com.jacky.grpc.proto.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloMethod() {
    io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply> getSayHelloMethod;
    if ((getSayHelloMethod = SimpleGrpc.getSayHelloMethod) == null) {
      synchronized (SimpleGrpc.class) {
        if ((getSayHelloMethod = SimpleGrpc.getSayHelloMethod) == null) {
          SimpleGrpc.getSayHelloMethod = getSayHelloMethod =
              io.grpc.MethodDescriptor.<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SayHello"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new SimpleMethodDescriptorSupplier("SayHello"))
              .build();
        }
      }
    }
    return getSayHelloMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloWithServerStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "sayHelloWithServerStream",
      requestType = com.jacky.grpc.proto.HelloRequest.class,
      responseType = com.jacky.grpc.proto.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloWithServerStreamMethod() {
    io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply> getSayHelloWithServerStreamMethod;
    if ((getSayHelloWithServerStreamMethod = SimpleGrpc.getSayHelloWithServerStreamMethod) == null) {
      synchronized (SimpleGrpc.class) {
        if ((getSayHelloWithServerStreamMethod = SimpleGrpc.getSayHelloWithServerStreamMethod) == null) {
          SimpleGrpc.getSayHelloWithServerStreamMethod = getSayHelloWithServerStreamMethod =
              io.grpc.MethodDescriptor.<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "sayHelloWithServerStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new SimpleMethodDescriptorSupplier("sayHelloWithServerStream"))
              .build();
        }
      }
    }
    return getSayHelloWithServerStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloWithClientStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "sayHelloWithClientStream",
      requestType = com.jacky.grpc.proto.HelloRequest.class,
      responseType = com.jacky.grpc.proto.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloWithClientStreamMethod() {
    io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply> getSayHelloWithClientStreamMethod;
    if ((getSayHelloWithClientStreamMethod = SimpleGrpc.getSayHelloWithClientStreamMethod) == null) {
      synchronized (SimpleGrpc.class) {
        if ((getSayHelloWithClientStreamMethod = SimpleGrpc.getSayHelloWithClientStreamMethod) == null) {
          SimpleGrpc.getSayHelloWithClientStreamMethod = getSayHelloWithClientStreamMethod =
              io.grpc.MethodDescriptor.<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "sayHelloWithClientStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new SimpleMethodDescriptorSupplier("sayHelloWithClientStream"))
              .build();
        }
      }
    }
    return getSayHelloWithClientStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloBiDirectStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "sayHelloBiDirectStream",
      requestType = com.jacky.grpc.proto.HelloRequest.class,
      responseType = com.jacky.grpc.proto.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest,
      com.jacky.grpc.proto.HelloReply> getSayHelloBiDirectStreamMethod() {
    io.grpc.MethodDescriptor<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply> getSayHelloBiDirectStreamMethod;
    if ((getSayHelloBiDirectStreamMethod = SimpleGrpc.getSayHelloBiDirectStreamMethod) == null) {
      synchronized (SimpleGrpc.class) {
        if ((getSayHelloBiDirectStreamMethod = SimpleGrpc.getSayHelloBiDirectStreamMethod) == null) {
          SimpleGrpc.getSayHelloBiDirectStreamMethod = getSayHelloBiDirectStreamMethod =
              io.grpc.MethodDescriptor.<com.jacky.grpc.proto.HelloRequest, com.jacky.grpc.proto.HelloReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "sayHelloBiDirectStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.jacky.grpc.proto.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new SimpleMethodDescriptorSupplier("sayHelloBiDirectStream"))
              .build();
        }
      }
    }
    return getSayHelloBiDirectStreamMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static SimpleStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<SimpleStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<SimpleStub>() {
        @java.lang.Override
        public SimpleStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SimpleStub(channel, callOptions);
        }
      };
    return SimpleStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static SimpleBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<SimpleBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<SimpleBlockingStub>() {
        @java.lang.Override
        public SimpleBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SimpleBlockingStub(channel, callOptions);
        }
      };
    return SimpleBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static SimpleFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<SimpleFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<SimpleFutureStub>() {
        @java.lang.Override
        public SimpleFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new SimpleFutureStub(channel, callOptions);
        }
      };
    return SimpleFutureStub.newStub(factory, channel);
  }

  /**
   * <pre>
   * 定义gRpc服务
   * </pre>
   */
  public interface AsyncService {

    /**
     * <pre>
     * 定义gRPC服务方法 - Unary
     * </pre>
     */
    default void sayHello(com.jacky.grpc.proto.HelloRequest request,
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Server Streaming --服务端流
     * </pre>
     */
    default void sayHelloWithServerStream(com.jacky.grpc.proto.HelloRequest request,
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSayHelloWithServerStreamMethod(), responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Client Streaming -客户端流
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloRequest> sayHelloWithClientStream(
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSayHelloWithClientStreamMethod(), responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - BiDirection Streaming -双向流
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloRequest> sayHelloBiDirectStream(
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSayHelloBiDirectStreamMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service Simple.
   * <pre>
   * 定义gRpc服务
   * </pre>
   */
  public static abstract class SimpleImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return SimpleGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service Simple.
   * <pre>
   * 定义gRpc服务
   * </pre>
   */
  public static final class SimpleStub
      extends io.grpc.stub.AbstractAsyncStub<SimpleStub> {
    private SimpleStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SimpleStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SimpleStub(channel, callOptions);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Unary
     * </pre>
     */
    public void sayHello(com.jacky.grpc.proto.HelloRequest request,
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Server Streaming --服务端流
     * </pre>
     */
    public void sayHelloWithServerStream(com.jacky.grpc.proto.HelloRequest request,
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
          getChannel().newCall(getSayHelloWithServerStreamMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Client Streaming -客户端流
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloRequest> sayHelloWithClientStream(
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncClientStreamingCall(
          getChannel().newCall(getSayHelloWithClientStreamMethod(), getCallOptions()), responseObserver);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - BiDirection Streaming -双向流
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloRequest> sayHelloBiDirectStream(
        io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getSayHelloBiDirectStreamMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service Simple.
   * <pre>
   * 定义gRpc服务
   * </pre>
   */
  public static final class SimpleBlockingStub
      extends io.grpc.stub.AbstractBlockingStub<SimpleBlockingStub> {
    private SimpleBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SimpleBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SimpleBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Unary
     * </pre>
     */
    public com.jacky.grpc.proto.HelloReply sayHello(com.jacky.grpc.proto.HelloRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getSayHelloMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Server Streaming --服务端流
     * </pre>
     */
    public java.util.Iterator<com.jacky.grpc.proto.HelloReply> sayHelloWithServerStream(
        com.jacky.grpc.proto.HelloRequest request) {
      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
          getChannel(), getSayHelloWithServerStreamMethod(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service Simple.
   * <pre>
   * 定义gRpc服务
   * </pre>
   */
  public static final class SimpleFutureStub
      extends io.grpc.stub.AbstractFutureStub<SimpleFutureStub> {
    private SimpleFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected SimpleFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new SimpleFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     * 定义gRPC服务方法 - Unary
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.jacky.grpc.proto.HelloReply> sayHello(
        com.jacky.grpc.proto.HelloRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getSayHelloMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_SAY_HELLO = 0;
  private static final int METHODID_SAY_HELLO_WITH_SERVER_STREAM = 1;
  private static final int METHODID_SAY_HELLO_WITH_CLIENT_STREAM = 2;
  private static final int METHODID_SAY_HELLO_BI_DIRECT_STREAM = 3;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_SAY_HELLO:
          serviceImpl.sayHello((com.jacky.grpc.proto.HelloRequest) request,
              (io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply>) responseObserver);
          break;
        case METHODID_SAY_HELLO_WITH_SERVER_STREAM:
          serviceImpl.sayHelloWithServerStream((com.jacky.grpc.proto.HelloRequest) request,
              (io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_SAY_HELLO_WITH_CLIENT_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.sayHelloWithClientStream(
              (io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply>) responseObserver);
        case METHODID_SAY_HELLO_BI_DIRECT_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.sayHelloBiDirectStream(
              (io.grpc.stub.StreamObserver<com.jacky.grpc.proto.HelloReply>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getSayHelloMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.jacky.grpc.proto.HelloRequest,
              com.jacky.grpc.proto.HelloReply>(
                service, METHODID_SAY_HELLO)))
        .addMethod(
          getSayHelloWithServerStreamMethod(),
          io.grpc.stub.ServerCalls.asyncServerStreamingCall(
            new MethodHandlers<
              com.jacky.grpc.proto.HelloRequest,
              com.jacky.grpc.proto.HelloReply>(
                service, METHODID_SAY_HELLO_WITH_SERVER_STREAM)))
        .addMethod(
          getSayHelloWithClientStreamMethod(),
          io.grpc.stub.ServerCalls.asyncClientStreamingCall(
            new MethodHandlers<
              com.jacky.grpc.proto.HelloRequest,
              com.jacky.grpc.proto.HelloReply>(
                service, METHODID_SAY_HELLO_WITH_CLIENT_STREAM)))
        .addMethod(
          getSayHelloBiDirectStreamMethod(),
          io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
            new MethodHandlers<
              com.jacky.grpc.proto.HelloRequest,
              com.jacky.grpc.proto.HelloReply>(
                service, METHODID_SAY_HELLO_BI_DIRECT_STREAM)))
        .build();
  }

  private static abstract class SimpleBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    SimpleBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.jacky.grpc.proto.HelloWorldProto.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("Simple");
    }
  }

  private static final class SimpleFileDescriptorSupplier
      extends SimpleBaseDescriptorSupplier {
    SimpleFileDescriptorSupplier() {}
  }

  private static final class SimpleMethodDescriptorSupplier
      extends SimpleBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    SimpleMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (SimpleGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new SimpleFileDescriptorSupplier())
              .addMethod(getSayHelloMethod())
              .addMethod(getSayHelloWithServerStreamMethod())
              .addMethod(getSayHelloWithClientStreamMethod())
              .addMethod(getSayHelloBiDirectStreamMethod())
              .build();
        }
      }
    }
    return result;
  }
}
